<?php
class Duenio extends Modelo_base {

	var $table = 'duenios';

	var $has_one = array("documento");
	var $has_many = array("afiliado");

    // Validaciones de campos
    var $validation = array(
        'nombre' => array(
            'label' => 'Nombre',
            'rules' => array('required', 'trim', 'max_length' => 30)
            ),
        'apellido' => array(
            'label' => 'Apellido',
            'rules' => array('required', 'trim', 'max_length' => 30)
            ),        
        'sexo' => array(
            'label' => 'Sexo',
            'rules' => array('required', 'trim', 'exact_length' => 1)
            ),
        'dni' => array(
            'label' => 'DNI',
            'rules' => array('required', 'numeric', 'unique')
            ),
        'domicilio' => array(
            'label' => 'Domicilio',
            'rules' => array('required', 'trim', 'max_length' => 50)
            ),
        'telefono' => array(
            'label' => 'Teléfono',
            'rules' => array('trim', 'max_length' => 20)
            ),
        'email' => array(
            'label' => 'Email',
            'rules' => array('trim', 'valid_email', 'max_length' => 80)
            ),
        'observaciones' => array(
            'label' => 'Observaciones',
            'rules' => array('trim', 'max_length' => 120)
            ),       
        'documento' => array(
            'label' => 'Documento',
            'rules' => array('required')
            )
    );

    // Optionally, don't include a constructor if you don't need one.
    function __construct($id = NULL)
    {
        parent::__construct($id);
    }
}

/* End of file duenio.php */
/* Location: ./application/models/duenio.php */